<!DOCTYPE html>
<!--conf
<sample>
              <product version="4.0b1" edition="std"/>
                     <modifications>
                            <modified date="130911"/>
                     </modifications>
               </sample>
-->
<html>
<head>
	<title>onActive/onBeforeActive events</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<style type="text/css">
		#log_here {
			font-size: 8pt;
			font-family: Tahoma;
			width: 500px;
			height: 120px;
			border: 1px solid #cecece;
			padding: 2px 5px;
			overflow: auto;
		}
	</style>
	<script>
		var myAcc;
		var eventIndex = 1;
		function doOnLoad() {
			
			myAcc = new dhtmlXAccordion({
				parent: "accObj",
				items: [
					{id: "a", text: "(a)"},
					{id: "b", text: "(b)"},
					{id: "c", text: "(c)"}
				]
			});
			
			myAcc.attachEvent("onBeforeActive", function(id){
				log("onBeforeActive event, cell: "+id);
				return true;
			});
			myAcc.attachEvent("onActive", function(id){
				log("onActive event, cell: "+id);
			});
		}
		
		function log(text) {
			var t = document.getElementById("log_here");
			t.innerHTML += (eventIndex++)+") "+text+"<br>";
			t.scrollTop = t.scrollHeight;
		}
	</script>
</head>
<body onload="doOnLoad();">
	<div id="accObj" style="position: relative; width: 320px; height: 400px;"></div>
	<br>
	<div id="log_here"></div>
</body>
</html>
